package io.renren;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.support.SpringBootServletInitializer;

import io.renren.modules.iots.utils.socket.client.SingleSocketClientThread;
import io.renren.modules.iots.utils.socket.client.SingleSocketReadThread;
import io.renren.modules.iots.utils.socket.server.NIOSServerForWeb;


@SpringBootApplication
@MapperScan(basePackages = {"io.renren.modules.*.dao"})
public class AdminApplication extends SpringBootServletInitializer {

	public static void main(String[] args) {
		//启动项目主线程
		SpringApplication.run(AdminApplication.class, args);
		
		NIOSServerForWeb.getInstance();
		
		//启动socket连接线程
		SingleSocketClientThread.getInstance();
		//启动socket读写线程
		SingleSocketReadThread.getInstance();
	}

	@Override
	protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
		return application.sources(AdminApplication.class);
	}
}
